import { FC } from 'react';
import { Form, FormItemProps as antdFormItemProps } from 'antd';

export interface FormItemProps extends Omit<antdFormItemProps, 'name'> {
  field: antdFormItemProps['name'];
}

const FormItem: FC<FormItemProps> = ({ field, children, ...restProps }) => (
  <Form.Item {...restProps} name={field}>
    {children}
  </Form.Item>
);

export default FormItem;
